All Questions
13 questions
0votes
1answer
1kviews
How to create multiple directories based on file names and change the file names in linux?
I have a directory AllData with some files like below: AllData |____ file_1to1000.track |____ file_1001to2000.track |____ file_2001to3000.track Based on file names I created directories with file ...
2votes
2answers
201views
How do I delete all directories with a certain file type in them?
I'm writing a command line script to 'unpack' folders with .svg files from downloads. I've copied the required files to a specific directory and now I need to delete all the directories with .svg ...
0votes
1answer
65views
How can I run a shell command that executes on subdirectories in a continuous manner?
I have a directory, that contains hundreds of subdirectories. The structure looks like this: directory ---> subdirectory_1 ---> file1 | |---> file2 ---&...
0votes
3answers
1kviews
How to move a file from a subdirectory to another subdirectory located outside the first one?
i am at fickurthe first one and trying to move the inner fickur to digital with only one command line, but cant seem to figure this one out. here is what i have tried so far: mv -v fickur/ ./...
0votes
1answer
262views
Copy folders has specific part of name and it is content
I have a long list of folder as follow: 001_bat_3513 002_mon_3213 003_bat_3515 004_btt_3540 005_bat_4513 055_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I copy the folders ( and ...
19votes
7answers
3kviews
Why do I have to cd out of a deleted directory?
On my server I have a directory structure looking something like this: /myproject/code I normally have an ssh connection to the server and 'stand' in that directory: root@machine:/myproject/code# ...
1vote
2answers
2kviews
How to strip directory structure with command line (or script)
I have a large collection of files packed into a two-level directory structure with many, many, many folders. In other words, I have a folder with a great many subfolders in it. There are no ...
81votes
6answers
217kviews
How do I remove all sub-directories from within a directory?
This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-...
11votes
3answers
7kviews
How can I cd to the previous/next sibling directory?
I often have a project directory layout like this project `-- component-a | `-- files... `-- component-b | `-- files... `-- component-c `-- files... I'll usually be working in one of the ...
28votes
6answers
16kviews
Best method to collect a random sample from a collection of files
Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?
64votes
5answers
8kviews
cd by just typing the directory's name?
I either had this somewhere 20 years ago or I dreamed about it. Basically: If if type blobblob I get blobblob: command not found Fair enough. I would like it so that when my shell gets those ...
5votes
1answer
1kviews
What is the tool that allows me to specify arbitrary directories using **
I once saw a colleague uses a tool which allows to use ** to represent any directories. For example: if a file called myfile.java sits deep inside: src/main/com/mycompany/product/store/myfile.java A ...
6votes
4answers
3kviews
Equivalent of forward/back buttons for unix shell (when navigating directories)?
I'd like to be able to type in terminal commands of forward/back especially if I went from a directory with a super-long name to home (and want to return back to the directory with the super-long name)...